
<?php
/*
foreach( new DirectoryIterator('/user/www/html/sites/default/files/images_e/f') as $file ){
	$mtime = $file->getMTime();    // Time file was created
	if((time()-$mtime)<=3600){ //last day
		$fname = $file->getFileName(); // File name
	}
}

$dir = "C:\file\";
if ($handle = opendir($dir)) {
    $latest = null;
    while (($cur = readdir($handle) !== false) {
        if ($latest == null || filectime($cur) > filectime($latest)) {
            $latest = $cur;
        }
    }
    closedir($handle);
}
return $latest;
*/

$files = glob('/user/www/html/sites/default/files/images_e/f/*.*');
$files = array_combine($files, array_map('filemtime', $files));
arsort($files);
foreach($files as $key => $time){
	if((time()-$time)<=216000){ //last day
		//print_r(time()-$time);
		print_r($key);
	}else{
		break;
	}
}

$files = glob('/user/www/html/sites/default/files/images_e/d/*.*');
$files = array_combine($files, array_map('filemtime', $files));
arsort($files);
foreach($files as $key => $time){
	if((time()-$time)<=216000){ //last day
		//print_r(time()-$time);
		print_r($key);
	}else{
		break;
	}
}
?>